home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / boyan51a.zip / ETCH.BSC < prev    next >
Text File  |  1993-11-15  |  2KB  |  35 lines

  1. \\ Sample script to turn BOYAN into an Etch-a-Sketch!
  2.  
  3. \\ This script is fairly advanced, demonstrating the following techniques:
  4. \\ 1. Cursor movement and screen control
  5. \\ 2. Saving the beeps & bells toggle for later restoring
  6. \\ 3. Reading and testing user input
  7. \\ 4. Separating a script into blocks: START, DRAW, and *WRAPUP
  8.  
  9. |START
  10. \GL-                      \\ switch into 25-line mode (if now in 43-line mode)
  11. \KS                       \\ keep (store) the current screen contents
  12. \ST[ Welcome to BOYAN Etch-A-Sketch! ]   \\ status message
  13. \SV3[%BB]                 \\ save current beeps&bells value in variable 3
  14. \BB-                      \\ turn beeps&bells off
  15. \KO[60]                   \\ set keyboard timeout to 60 seconds
  16. \GX[40]  \GY[12]          \\ start in the middle of the screen (40,12)
  17. \DM%XP,%YP[▒]             \\ display a shaded block at cursor position
  18.  
  19. |DRAW
  20. \DM1,24[<I>=up │ <J>=left │ <K>=right │ <M>=down │ <Esc>=exit       ]
  21. \DM24[│ X-pos=%XP │ Y-pos=%YP ] \\ display status on line 1
  22. \KV1_[Your Etch-a-sketch command? ]          \\ get char input from keybd
  23. \DM%XP,%YP[ ]             \\ display a space at current x,y cursor posn
  24. \IV1+I[\RY[-1]]           \\ move up if input="I"
  25. \IV1+J[\RX[-1]]           \\ move left if input="J"
  26. \IV1+K[\RX[1]]            \\ move right if input="K"
  27. \IV1+M[\RY[1]]            \\ move down if input="M"
  28. \DM%XP,%YP[▒]             \\ display a shaded block at cursor position
  29. \GB[DRAW]                 \\ loop back for more input!
  30.  
  31. |*WRAPUP
  32. \RS                       \\ restore previous screen contents
  33. \IE+%V3,ON[\BB+]          \\ turn beeps&bells back on if they were on before
  34. \ST[Etch-a-sketch completed!]  \\ Status message
  35.